[[viewer browser] scrollToSelection]; // make sure the selected item is visible
}
[viewer setDocEdited:LOOKS_CHANGED];
// Set the viewer's title to show the folder's filename
if ( filename )
[viewer setTitleAsFilename:filename];
else {
sprintf ( path, "UNTITLED" );
[viewer setTitleAsFilename:path];
}
[viewer display];
[[viewer reenableFlushWindow] flushWindow];
//if ( DEBUGGING ) printf ( " Done.\n" );
fFlags.needsShow = NO;
[inspector update];
return ( self );
}
#define HORIZ_STEP 24
#define VERT_STEP 24
- obtainViewer:newViewer
/*
If newViewer is not nil, replace the current viewer with the newViewer and return. If folder doesn't already have a viewer, then loads a new Folder.nib to create a new FolderViewer, then sizes and locates it as appropriate.
*/
{
static BOOL firstOne = YES;
// This will always cause a need to be re-shown...
[self setNeedsShow:YES];
if ( newViewer && newViewer != viewer ) {
[viewer free]; // Free the old viewer
viewer = newViewer;
viewerNum = [[newViewer delegate] viewerNum];
[viewer setDelegate:self];
fFlags.needsSort = YES;
}
if ( viewer ) { // Already has a viewer
[viewer placeWindow:&frameRect];
return ( self );
}
/*
Create a new viewer
*/
// Load a new copy of the nib
// viewer is automatically set to the loaded window
[NXApp loadNibSection:"Folder.nib"
owner:self withNames:NO
fromZone:[self zone]];
if ( frameRect.origin.x == NEEDS_NEW_VIEWER ) {
if ( self != [folderController keyFolder] && !firstOne
Sets the replaceGroups flag, which will cause all group files in the folder directory to first be removed before the current versions are written the next time the folder is saved.
int compareGroups ( Group **group1, Group **group2 )
/*
Compare the two groups for sorting. First, compares their key equivalents, then compares them alphabetically. Returns less than 0 if group1<group2, 0 if group1==group2, greater than 0 if group1>group2.
THIS METHOD IS CURRENTLY BROKEN
*/
{
int compare = 0;
if ( [*group1 keyEquivalent] < [*group2 keyEquivalent] ) {